package com.liushao.controller;


import com.liushao.entity.Dict;
import com.liushao.result.Result;
import com.liushao.service.DictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 数据字典 前端控制器
 * </p>
 *
 * @author chen
 * @since 2025-01-03
 */
@Api(tags = "数据字典管理")
@RestController
@RequestMapping("/api/core/dict")
public class ApiDictController {

    @Autowired
    private DictService dictService;

    ///api/core/dict/findByDictCode/education
    //  dictList
     @ApiOperation("根据dictCode获取下一级节点")
    @GetMapping("/findByDictCode/{dictCode}")//通用
    public Result findByDictCode(
            @ApiParam(value = "节点编码",required = true)
            @PathVariable String dictCode
     ){

        List<Dict> list= dictService.findByDictCode(dictCode);

        return  Result.ok().data("dictList",list);

     }

}

